<style lang="scss">
@import 'uview-plus/index.scss';
//
</style>

<script setup lang="ts">
import { onLaunch, onShow } from '@dcloudio/uni-app'
import { useAppStore } from './stores/app'
import { useUserStore } from './stores/user'
import { apiIndexVisit } from '@/api/app'
import { getClient } from '@/utils/client'
import { useThemeStore } from './stores/theme'
import { useLocation } from '@/hooks/useLocation'
import {apiGetTaskByShare} from '@/api/task'

const { getConfig, getSystemInfo, getKefuInfo } = useAppStore()
const { getUser,isLogin } = useUserStore()
const { getTheme } = useThemeStore()
const { getLocationData } = useLocation()


onLaunch(async (options:any) => {

    // #ifdef MP-WEIXIN
    wx.cloud.init({
        // appid:'wxb2060950af16c3eb'
    })
    // #endif

    console.log('App Launch', options)

    //统计
    await apiIndexVisit({
        terminal: getClient()
    })

    //登陆
    getUser()

    //是否是分享进来的打工仔
    // if(query.sharecode){
    //     const tasklist =await apiGetTaskByShare(query);
    // }
    // await getConfig()
    // await getTheme()
    getSystemInfo()
    // getLocationData()
    // #ifdef H5
    // const { status, page_status, page_url } = appStore.getH5Config
    // if (status == 0) {
    // 	if (page_status == 1) return (location.href = page_url)
    // 	uni.reLaunch({ url: '/pages/empty/empty' })
    // }
    // #endif
    // await getUser()
    // await apiIndexVisit({
    //     terminal: getClient()
    // })
    // getKefuInfo()
})

onShow(async () => {

})



</script>
